import db from '../utils/dbconf'
import { decode } from 'js-base64'
import { SQL_ERROR,LIMIT_LENGTH } from '../server.config.js'
const TABLE_NAME = 'PLACARD'

export default{
  get:async ({body}, res, next) => {
		try{
			const plas = await db.table(TABLE_NAME)
        .where(`overday >= 1`)
        .order('createtime DESC')
        .select()
			return res.send({code:200,data:{plas}})
		}catch(e){
			console.log({e})
			return res.send(SQL_ERROR)
		}
	},
	passday:async ()=>{
		await db.table(TABLE_NAME).where(`overday >= 1`).updateDec('overday')
	}
}